<%@ page import="gdepot.Orders" %>
<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main">
    <g:set var="entityName" value="${message(code: 'orders.label', default: 'Orders')}"/>
    <title><g:message code="default.show.label" args="[entityName]"/></title>
</head>

<body>

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><g:link controller="orders" action="mineOrders">Order</g:link></li>
        </ol>
    </div>
</div>

<g:if test="${flash.message}">
    <div class="alert alert-warning">
        <a href="#" class="close" data-dismiss="alert">
        &times;
        </a>
        <strong>${flash.message}</strong>
    </div>
</g:if>

<sec:ifAllGranted roles="ROLE_SYSTEM_ADMINISTRATOR">
    <div class="row" style="padding-bottom:10px">
        <div class="container">
            <div class="col-sm-9"></div>

            <div class="col-sm-3" align="right" style="padding:0px">
                <ul class="list-inline">
                    <li>
                        <g:form url="[resource: ordersInstance, action: 'delete']" method="DELETE">
                            <g:actionSubmit class="btn btn-default btn-sm" action="delete" value="删除"/>
                        </g:form>
                    </li>
                    <li><g:link action="edit" resource="${ordersInstance}"
                                class="btn btn-default btn-sm">编辑</g:link></li>
                    <li><g:link action="create" class="btn btn-default btn-sm">新建</g:link></li>
                </ul>
            </div>
        </div>
    </div>
</sec:ifAllGranted>

<div class="row">
    <div class="container">
        <table class="table table-bordered table-hover">
            <tr>
                <td width="30%">订单号：</td>
                <td width="70%"><g:if test="${ordersInstance?.id}"><g:fieldValue bean="${ordersInstance}"
                                                                                 field="id"/></g:if></td>
            </tr>
            <tr>
                <td width="30%">收货人：</td>
                <td width="70%"><g:if test="${ordersInstance?.receiverName}"><g:fieldValue bean="${ordersInstance}"
                                                                                           field="receiverName"/></g:if></td>
            </tr>
            <tr>
                <td width="30%">联系方式：</td>
                <td width="70%"><g:if test="${ordersInstance?.phone}"><g:fieldValue bean="${ordersInstance}"
                                                                                    field="phone"/></g:if></td>
            </tr>

            <tr>
                <td width="30%">收货地址：</td>
                <td width="70%"><g:if test="${ordersInstance?.address}"><g:fieldValue bean="${ordersInstance}"
                                                                                      field="address"/></g:if></td>
            </tr>
            <tr>
                <td width="30%">价格：</td>
                <td width="70%"><g:if test="${ordersInstance?.price}"><g:fieldValue bean="${ordersInstance}"
                                                                                    field="price"/></g:if></td>
            </tr>
            <tr>
                <td width="30%">发货日期：</td>
                <td width="70%"><g:if test="${ordersInstance?.shipDate}"><g:formatDate bean="${ordersInstance}"
                                                                                       field="shipDate"/></g:if></td>
            </tr>
            <tr>
                <td width="30%">订单状态：</td>
                <td width="70%"><g:if test="${ordersInstance?.status}"><g:fieldValue bean="${ordersInstance}"
                                                                                     field="status"/></g:if></td>
            </tr>
            <tr>
                <td width="30%">付款方式：</td>
                <td width="70%"><g:if test="${ordersInstance?.accountBank}"><g:link controller="accountBank"
                                                                                    action="show"
                                                                                    id="${ordersInstance?.accountBank?.id}">${ordersInstance?.accountBank?.encodeAsHTML()}</g:link></g:if></td>
            </tr>
            <tr>
                <td width="30%">修改日期：</td>
                <td width="70%"><g:if test="${ordersInstance?.modifiedDate}"><g:formatDate bean="${ordersInstance}"
                                                                                           field="modifiedDate"/></g:if></td>
            </tr>
            <tr>
                <td width="30%">创建日期：</td>
                <td width="70%"><g:if test="${ordersInstance?.modifiedDate}"><g:formatDate bean="${ordersInstance}"
                                                                                           field="modifiedDate"/></g:if></td>
            </tr>
            <tr>
                <td width="30%">所属购物车：</td>
                <td width="70%"><g:if test="${ordersInstance?.cart}"><g:link controller="cart" action="show"
                                                                             id="${ordersInstance?.cart?.id}">${ordersInstance?.cart?.encodeAsHTML()}</g:link></g:if></td>
            </tr>
            <td width="30%">拥有者：</td>
            <td width="70%"><g:if test="${ordersInstance?.user}"><g:link controller="users" action="show"
                                                                         id="${ordersInstance?.user?.id}">${ordersInstance?.user?.encodeAsHTML()}</g:link></g:if></td>
        </tr>

        </table>

    </div>
</div>
</body>
</html>
